<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		in: 检测某个对象是否含有某个属性,(不论这个属性是私有还是公有)
		有 : true 没有:false
		<script>
			function Person(name, age) {
				this.name = name;
				this.age = age;
			}

			Person.prototype.job = "CEO";

			let p = new Person("lili", 18)

			console.log(p);

			console.log("job" in p); //公有 Person.prototype
			console.log("name" in p); //私有
			console.log("toString" in p); //公有 Object.prototype
			console.log("numa" in p); //false
		</script>

		<script>
			function fn() {
				this.x = 100;
				this.y = 100;
			}
			fn.prototype.getX = function() {}
			var f1 = new fn();
			console.log(f1.hasOwnProperty("x"));
			console.log(f1.hasOwnProperty("getX"));
			console.log(fn.prototype.hasOwnProperty("getX")); 
			console.log(fn.prototype.hasOwnProperty("getY")); 
		</script>
	</body>
</html>
